# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Solar.V1.Model.BuildingInsights do
  @moduledoc """
  Response message for `Solar.FindClosestBuildingInsights`. Information about the location, dimensions, and solar potential of a building.

  ## Attributes

  *   `administrativeArea` (*type:* `String.t`, *default:* `nil`) - Administrative area 1 (e.g., in the US, the state) that contains this building. For example, in the US, the abbreviation might be "MA" or "CA."
  *   `boundingBox` (*type:* `GoogleApi.Solar.V1.Model.LatLngBox.t`, *default:* `nil`) - The bounding box of the building.
  *   `center` (*type:* `GoogleApi.Solar.V1.Model.LatLng.t`, *default:* `nil`) - A point near the center of the building.
  *   `imageryDate` (*type:* `GoogleApi.Solar.V1.Model.Date.t`, *default:* `nil`) - Date that the underlying imagery was acquired. This is approximate.
  *   `imageryProcessedDate` (*type:* `GoogleApi.Solar.V1.Model.Date.t`, *default:* `nil`) - When processing was completed on this imagery.
  *   `imageryQuality` (*type:* `String.t`, *default:* `nil`) - The quality of the imagery used to compute the data for this building.
  *   `name` (*type:* `String.t`, *default:* `nil`) - The resource name for the building, of the format `buildings/{place_id}`.
  *   `postalCode` (*type:* `String.t`, *default:* `nil`) - Postal code (e.g., US zip code) this building is contained by.
  *   `regionCode` (*type:* `String.t`, *default:* `nil`) - Region code for the country (or region) this building is in.
  *   `solarPotential` (*type:* `GoogleApi.Solar.V1.Model.SolarPotential.t`, *default:* `nil`) - Solar potential of the building.
  *   `statisticalArea` (*type:* `String.t`, *default:* `nil`) - Statistical area (e.g., US census tract) this building is in.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :administrativeArea => String.t() | nil,
          :boundingBox => GoogleApi.Solar.V1.Model.LatLngBox.t() | nil,
          :center => GoogleApi.Solar.V1.Model.LatLng.t() | nil,
          :imageryDate => GoogleApi.Solar.V1.Model.Date.t() | nil,
          :imageryProcessedDate => GoogleApi.Solar.V1.Model.Date.t() | nil,
          :imageryQuality => String.t() | nil,
          :name => String.t() | nil,
          :postalCode => String.t() | nil,
          :regionCode => String.t() | nil,
          :solarPotential => GoogleApi.Solar.V1.Model.SolarPotential.t() | nil,
          :statisticalArea => String.t() | nil
        }

  field(:administrativeArea)
  field(:boundingBox, as: GoogleApi.Solar.V1.Model.LatLngBox)
  field(:center, as: GoogleApi.Solar.V1.Model.LatLng)
  field(:imageryDate, as: GoogleApi.Solar.V1.Model.Date)
  field(:imageryProcessedDate, as: GoogleApi.Solar.V1.Model.Date)
  field(:imageryQuality)
  field(:name)
  field(:postalCode)
  field(:regionCode)
  field(:solarPotential, as: GoogleApi.Solar.V1.Model.SolarPotential)
  field(:statisticalArea)
end

defimpl Poison.Decoder, for: GoogleApi.Solar.V1.Model.BuildingInsights do
  def decode(value, options) do
    GoogleApi.Solar.V1.Model.BuildingInsights.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Solar.V1.Model.BuildingInsights do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
